package LEKIEUANH.OOP.LEVEL2.ex01;

import LEKIEUANH.OOP.Triangle;

public class TriangleEntity {
	private double side1;
	private double side2;
	private double side3;
	
	public TriangleEntity(){
		side1 = 1.0;
		side2 = 1.0;
		side3 = 1.0;
	}
	public TriangleEntity(double side1, double side2, double side3){
		this.side1 = side1;
		this.side2 = side2;
		this.side3 = side3;
	}
	public double getSide1() {
		return side1;
	}
	public void setSide1(double side1) {
		this.side1 = side1;
	}
	public double getSide2() {
		return side2;
	}
	public void setSide2(double side2) {
		this.side2 = side2;
	}
	public double getSide3() {
		return side3;
	}
	public void setSide3(double side3) {
		this.side3 = side3;
	}
	public double Area(TriangleEntity objTriangle ){
		double p = (objTriangle.getSide1()+objTriangle.getSide2()+objTriangle.getSide3())/2;
		return  Math.sqrt(p*(p - objTriangle.getSide1())*(p - objTriangle.getSide2())*(objTriangle.getSide3()));
	}
	public double Peri(TriangleEntity objTriangle){
		return objTriangle.getSide1()+objTriangle.getSide2()+objTriangle.getside3();
	}

}
